/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gardenmaker;

import java.awt.Graphics;
import java.awt.geom.Area;
import java.awt.Shape;



/**
 *
 * @author lenny
 */
public class Forma {
    
     protected int x, y;
     protected int largura;
     protected int altura;
     protected java.awt.Rectangle selBox;
     protected Area formaArea;
     protected Shape formaShape;
     protected boolean selected;
     protected String name;
     protected int rotacao;
     public Propriedades janelaProp;
     public JdialogPropriedades jprop;
     
    public Forma(int x, int y, String name) {
        this.x = x;
        this.y = y;
        selected = false;
        selBox = null;
        rotacao = 0;
        jprop = new JdialogPropriedades(null, selected);
        jprop.setTName(name);
        jprop.setForma(this);
        jprop.setVisible(false);
        jprop.setLocation(x, y);
        
    }
    
    public int getLargura(){
        return largura;
    }
    
    public int getAltura(){
        return altura;
    }
    
    public int getX(){
        return x;
    }
    
    
    public int getY(){
        return y;
    }
    
    public void setName(String s){
        this.name = s;
    }
    
    public void setRotacao(int rotacao){
        this.rotacao = rotacao;
    }
    
    public int getRotacao(){
        return rotacao;
    }
    
    public void setSelected(boolean sel){
        selected=sel;
    }
    
    public boolean getSelected(){
        return selected;
    }
    
    public void selectionSquare() {
       selBox= formaArea.getBounds();
       selBox.height=selBox.height+10;
       selBox.x = selBox.x-5;
       
       selBox.width = selBox.width+10;
       selBox.y = selBox.y-5;         
    }
    
    public float percentConvert(int velho, int novo){
        float c;
        c= (novo*100) / velho;
        c= c/100;
        
        return c;
    }

    public void setXY(int x, int y) {
        
    }

    

    public void setAltura(int a) {
        altura = a;
        selectionSquare();
    }

    public void setLargura(int l) {
        largura = l;
        selectionSquare();
    }
    
    public void setArea(Area ar){
        
    }

   
    public void desenharSelBox(Graphics g) {
        
    }
    
    public void desenhar(Graphics g){
        
    }
    
    public Area getArea(){
        return null;
    }
    
}
